Estimated read time: 4 minutes
Writer has some support for interdependent (or hierarchical) tracked changes: e.g. the case when you have a delete on top of an insert. While there were some working cases, handling of many combinations were missing. I started to make systematic improvements in this area in the recent past, this post gives you an overview what's done so far.
This work is primarily for Collabora Online, but the feature is available in desktop Writer as well.
Motivation¶
DOCX files in Word can often have overlapping tracked changes: Writer tries to split these up to make sure there is only one tracked change under the cursor at the same time. Still, it's possible that you have a tracked change with multiple types: e.g. a delete on top of an insert.
The focus in on 3 combinations which appear in DOCX files a lot: "insert, then delete", "insert, then format" and "delete, then format".
This mostly affects the UI and import/export filters of ODT and DOCX.
Results so far¶
Given an insert, then delete:
Most operations worked nicely here, but in case your cursor was in the middle of AAA and you did a reject, followed by an undo, proper handling of that was missing, now implemented.
But then given an insert, then a format:
Then a handling of more actions were missing:
- DOCX import is now implemented.
- ODT import is now implemented.
- Accepting when you're inside AAA is now implemented: the insert is accepted for BBB but the format stays unchanged.
- Rejecting when you're inside AAA is now implemented: the insert is rejected and BBB is also removed, together with the format on top of it.
- Accepting the BBB now correctly operates on the insert type, so the format type remains after accept.
- If you accept BBB, now the surrounding AAA and CCC also get accepted as well, as expected.
- Now if you reject BBB, then it gets removed from the document, since you rejected an insert.
- When you reject BBB, the surrounding AAA and CCC also get rejected.
The combined implementation of these should give you a smooth feeling in case you're used to how Word works: if there is a format redline combined with an insert, then the operations act on the insert type, and format is only accepted/rejected when there is no insert "under" the format.
Similarly: it's a bit of an implementation detail that Writer splits redlines on DOCX import: so if you e.g. accept AAA then we combine that with BBB and CCC when it makes sense, so you need to click a lot less.
Finally, given a delete, then a format:
Then again handling of some actions were missing:
- DOCX import is now implemented.
- ODT import is now implemented.
- ODT export is now implemented.
- Accepting AAA now correctly operates on the delete type of BBB.
- Rejecting AAA now correctly operates on the delete type of BBB.
- Accepting BBB now correctly works with the delete type.
- Accepting BBB now correctly tries to also accept AAA and CCC, too.
The current state is not yet complete, but it's a big improvement over what we had in the past, which was mostly focusing on just "insert, then delete".
You may wonder what about some other cases: if you insert some content with change tracking, that always creates a new tracked change, so "insert" is never on top of something else. Similarly, format is always on top of something. Finally the same type is never on top of itself.
How is this implemented?¶
If you would like to know a bit more about how this works, continue reading... :-)
As usual, the high-level problem was addressed by a series of small changes. Core side:
- tdf#166319 sw interdependent redlines: fix undo of del on top of ins
- tdf#166319 sw interdependent redlines: handle format on top of insert
- tdf#166319 sw interdependent redlines: handle accept of insert under format
- tdf#166319 sw interdependent redlines: handle reject of insert under format
- tdf#166319 sw interdependent redlines: handle accept of delete under format
- tdf#166319 sw interdependent redlines: fix DOCX export of delete under format
- tdf#166319 sw interdependent redlines: handle reject of delete under format
- tdf#166319 sw interdependent redlines: handle ODF import of insert under format
- tdf#166319 sw interdependent redlines: handle ODF export of delete under format
- tdf#166319 sw interdependent redlines: handle ODF import of delete under format
- tdf#166319 sw interdependent redlines: handle accept of ins-then-fmt's fmt
- tdf#166319 sw interdependent redlines: combine on accept of ins-then-fmt's fmt
- tdf#166319 sw interdependent redlines: handle reject of ins-then-fmt's fmt
- tdf#166319 sw interdependent redlines: combine on reject of ins-then-fmt's fmt
- tdf#166319 sw interdependent redlines: handle accept of del-then-fmt's fmt
- tdf#166319 sw interdependent redlines: combine on accept of del-then-fmt's fmt
- tdf#166319 sw interdependent redlines: handle reject of del-then-fmt's fmt
Want to start using this?¶
You can get a development edition of Collabora Online 25.04 and try it out yourself right now: try the development edition. Collabora intends to continue supporting and contributing to LibreOffice, the code is merged so we expect all of this work will be available in TDF's next release too (25.8).